sgdk
vdp_dma.h File Reference

VDP DMA support. More...

Go to the source code of this file.

Defines

#define VDP_DMA_VRAM   0
#define VDP_DMA_CRAM   1
#define VDP_DMA_VSRAM   2
#define VDP_doVRamDMA(from, to, len)   VDP_doDMA(VDP_DMA_VRAM, from, to, len)
#define VDP_doCRamDMA(from, to, len)   VDP_doDMA(VDP_DMA_CRAM, from, to, len)
#define VDP_doVSRamDMA(from, to, len)   VDP_doDMA(VDP_DMA_VSRAM, from, to, len)

Functions

void VDP_doDMAEx (u8 location, u32 from, u16 to, u16 len, s16 vramStep)
 Do DMA transfert operation.
void VDP_doDMA (u8 location, u32 from, u16 to, u16 len)
 Do DMA transfert operation.
void VDP_doVRamDMAFill (u16 to, u16 len, u8 value)
 Do VRAM DMA fill operation.
void VDP_doVRamDMACopy (u16 from, u16 to, u16 len)
 Do VRAM DMA copy operation.

Detailed Description

VDP DMA support.

Author:
Stephane Dallongeville
Date:
08/2011

This unit provides methods to use the VDP DMA capabilities.


Define Documentation

#define VDP_DMA_CRAM   1

CRAM location for DMA operation.

#define VDP_DMA_VRAM   0

VRAM location for DMA operation.

#define VDP_DMA_VSRAM   2

VSRAM location for DMA operation.

#define VDP_doCRamDMA (   from,
  to,
  len 
)    VDP_doDMA(VDP_DMA_CRAM, from, to, len)

Start DMA transfert to CRAM.

Parameters:
fromSource address.
toDestination address in CRAM.
lenNumber of word to transfert.
#define VDP_doVRamDMA (   from,
  to,
  len 
)    VDP_doDMA(VDP_DMA_VRAM, from, to, len)

Start DMA transfert to VRAM.

Parameters:
fromSource address.
toDestination address in VRAM.
lenNumber of word to transfert.
#define VDP_doVSRamDMA (   from,
  to,
  len 
)    VDP_doDMA(VDP_DMA_VSRAM, from, to, len)

Start DMA transfert to VSRAM.

Parameters:
fromSource address.
toDestination address in VSRAM.
lenNumber of word to transfert.

Function Documentation

void VDP_doDMA ( u8  location,
u32  from,
u16  to,
u16  len 
)

Do DMA transfert operation.

Parameters:
locationDestination location.
Accepted values:
  • VDP_DMA_VRAM (for VRAM transfert).
  • VDP_DMA_CRAM (for CRAM transfert).
  • VDP_DMA_VSRAM (for VSRAM transfert).
fromSource address.
toDestination address.
lenNumber of word to transfert.
void VDP_doDMAEx ( u8  location,
u32  from,
u16  to,
u16  len,
s16  vramStep 
)

Do DMA transfert operation.

Parameters:
locationDestination location.
Accepted values:
  • VDP_DMA_VRAM (for VRAM transfert).
  • VDP_DMA_CRAM (for CRAM transfert).
  • VDP_DMA_VSRAM (for VSRAM transfert).
fromSource address.
toDestination address.
lenNumber of word to transfert.
vramStepVRam address increment value (-1 to 255).
By default you should set it to 2 for normal copy operation but you can use different value for specific operation.
-1 means the VRam address increment register won't be modified (use current value).
void VDP_doVRamDMACopy ( u16  from,
u16  to,
u16  len 
)

Do VRAM DMA copy operation.

Parameters:
fromSource address.
toDestination address.
lenNumber of byte to copy.
void VDP_doVRamDMAFill ( u16  to,
u16  len,
u8  value 
)

Do VRAM DMA fill operation.

Parameters:
toDestination address.
lenNumber of byte to fill.
valueFill value (byte).
 All Classes Files Functions Variables Typedefs Enumerations Defines